import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert';

part 'links_response.freezed.dart';
part 'links_response.g.dart';

@freezed
class LinksResponse with _$LinksResponse {
  const factory LinksResponse({
    @JsonKey(name: "c") required int c,
    @JsonKey(name: "m") required String m,
    @JsonKey(name: "d") required D d,
  }) = _LinksResponse;

  factory LinksResponse.fromJson(Map<String, dynamic> json) =>
      _$LinksResponseFromJson(json);
}

@freezed
class D with _$D {
  const factory D({
    @JsonKey(name: "nav1") required Map<String, Nav1> nav1,
  }) = _D;

  factory D.fromJson(Map<String, dynamic> json) => _$DFromJson(json);
}

@freezed
class Nav1 with _$Nav1 {
  const factory Nav1({
    @JsonKey(name: "url") required String url,
    @JsonKey(name: "title") required String title,
    @JsonKey(name: "images") required String images,
  }) = _Nav1;

  factory Nav1.fromJson(Map<String, dynamic> json) => _$Nav1FromJson(json);
}
